package demo.generic;


import java.util.Random;

public class RobotFactory implements GenericIFactory<String, Integer> {

    private String[] stringRobot = new String[]{"hello", "hi"};
    private Integer[] integerRobot = new Integer[]{123, 1};

    @Override
    public String nextObject() {
        return stringRobot[new Random().nextInt(2)];
    }

    @Override
    public Integer nextNumber() {
        return integerRobot[new Random().nextInt(2)];
    }


    public static void main(String[] args) {
        GenericIFactory  genericIFactory = new RobotFactory();
        System.out.println(genericIFactory.nextObject());
        System.out.println(genericIFactory.nextNumber());
    }
}
